//
//  SettingsViewController.h
//  NXTRemoteController
//
//  Created by naceka on 14.05.12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Robot.h"

@interface SettingsUIViewController : UIViewController <UITextFieldDelegate> {
	UIButton * connectBtn;	
	UITextField * nxtId;
	UISegmentedControl * leftMotor;
	UISegmentedControl * rightMotor;
	UISegmentedControl * sensor1;
	UISegmentedControl * sensor2;
	UISegmentedControl * sensor3;
	UISegmentedControl * sensor4;
	
	//for indicator
	UIView * indicatorView;
	UIActivityIndicatorView * indicator;
	
	//robot
	Robot * robot;
	//nxt id mac
	bd_addr_t device_address;
	//temp flag
	bool connected;
}

@property (nonatomic, retain) IBOutlet UIButton * connectBtn;
@property (nonatomic, retain) IBOutlet UITextField * nxtId;
@property (nonatomic, retain) IBOutlet UISegmentedControl * leftMotor;
@property (nonatomic, retain) IBOutlet UISegmentedControl * rightMotor;
@property (nonatomic, retain) IBOutlet UISegmentedControl * sensor1;
@property (nonatomic, retain) IBOutlet UISegmentedControl * sensor2;
@property (nonatomic, retain) IBOutlet UISegmentedControl * sensor3;
@property (nonatomic, retain) IBOutlet UISegmentedControl * sensor4;

//init
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil andRobot:(Robot *) rbt;

//on connect pressed
- (IBAction) connectPressed:(id) sender;

//method to check nxt id
- (bool) checkNxtId:(NSString *) string;

//return sensor
- (Sensor *) getSensorNameFromNumber:(int) number;

//indicator
- (void) showIndicator;
- (void) hideIndicator;

//disable widgets
- (void) setWidgetsState:(BOOL) state;

//NSNotificationCenter
- (void) deviceConnected;
- (void) deviceDisconnected;
@end
